package v1

import (
	"go_admin/internal/database/system/model/dto"
	"go_admin/internal/database/system/model/entity"

	"github.com/gogf/gf/v2/frame/g"
)

type GetPersonalInfoReq struct {
	g.Meta `path:"/personal/getPersonalInfo" tags:"用户管理" method:"get" summary:"登录用户信息"`
}

type GetPersonalInfoRes struct {
	User     *entity.SysUser `json:"user"`
	Roles    []string        `json:"roles"`
	DeptName string          `json:"deptName"`
}

type PersonalEditReq struct {
	g.Meta    `path:"/personal/edit" tags:"用户管理" method:"put" summary:"修改个人资料"`
	Nickname  string `p:"nickname" v:"required#用户昵称不能为空"`
	Mobile    string `p:"mobile" v:"required|phone#手机号不能为空|手机号格式错误"`
	Remark    string `p:"remark"`
	Sex       int    `p:"sex"`
	UserEmail string `p:"user_email" v:"required|email#邮箱不能为空|邮箱格式错误"`
	Describe  string `p:"describe"`
	Avatar    string `p:"avatar"`
}

type PersonalEditRes struct {
	UserInfo *dto.LoginUserRes `json:"userInfo"`
	Token    string            `json:"token"`
}

type ResetPwdReq struct {
	g.Meta   `path:"/personal/resetPwd" tags:"用户管理" method:"put" summary:"修改密码"`
	Password string `p:"password" v:"required|password#密码不能为空|密码以字母开头，只能包含字母、数字和下划线，长度在6~18之间"`
}

type ResetPwdRes struct{}
